from selenium import webdriver

class WebUtilDriver:
      _driver=None

      @classmethod
      def get_driver(cls):
          if cls._driver is None:
              cls._driver = webdriver.Chrome(r'C:\Program Files\Google\Chrome\Application\chromedriver.exe')
              cls._driver.get('http://www.tp_shop.cn/Home/user/login.html')
              return cls._driver
          else:
              return cls._driver

      @classmethod
      def cancel_driver(cls):
          if cls._driver is not None:
              cls._driver.quit()
